<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			.y1 {
				color: red;
			}
			.y2 {
				color: green;
			}
		</style>
	</head>
	<body>
		<span class="y1">hello world !</span>
		<script>
			alert("字体颜色会发生改变");
			var f = document.getElementsByClassName("y1");
			alert("当前字体颜色是"+f[0].className);
			f[0].className="y2";
		</script>
	</body>
</html>
